//
// Created by Yun on 2025/3/3.
//

#ifndef FRMAEWORK_DEMO_GPIO_FLASH_INTERFACE_H
#define FRMAEWORK_DEMO_GPIO_FLASH_INTERFACE_H

#include "interface_common_type.h"

/**
 * @brief FLASH接口结构体
 */
typedef struct Flash_Interface {
    /**
     * @brief 初始化FLASH
     * @param u32FlashBase FLASH基地址
     * @param u32FlashPageSize FLASH页大小
     * @param u32FlashSize FLASH总大小
     * @return BSP_OK:成功; BSP_ERROR:失败
     */
    uint8_t (*Init)   (uint32_t u32FlashBase, uint32_t u32FlashPageSize, uint32_t u32FlashSize);
    uint8_t (*Erase)    (uint32_t u32Addr, uint32_t u32Len);
    uint8_t (*Write)    (uint32_t u32Addr, void* pBuffer, uint32_t u32Len, uint32_t u8Mode);
    uint8_t (*Read)     (uint32_t u32Addr, void* pBuffer, uint32_t u32Len, uint32_t u8Mode);
}Flash_Interface_TypeDef;

#endif //FRMAEWORK_DEMO_GPIO_FLASH_INTERFACE_H
